#from pydantic import BaseSettings
from pydantic_settings import BaseSettings
from pydantic import ConfigDict
import os

class Settings(BaseSettings):
    # 应用程序设置
    PROJECT_NAME: str = "RAG Text2SQL评估系统"
    VERSION: str = "1.0.0"
    DEBUG: bool = True
    
    # 数据库设置
    CHROMA_DB_PATH: str = "/appslog/RAG03_code/rag-project03-raggs-master/backend/chroma_db"
    
    # 模型设置
    TEXT_EMBEDDING_MODEL: str = "/appslog/RAG03_code/rag-project03-raggs-master/backend/models/sentence-transformers/all-MiniLM-L6-v2"
    TEXT2SQL_MODEL: str = "/appslog/RAG03_code/rag-project03-raggs-master/backend/models/sentence-transformers/google/flan-t5-small"
    
    # 评估设置
    EVAL_THRESHOLD: float = 0.7
    
    # 禁用ChromaDB遥测功能
    CHROMA_DISABLE_TELEMETRY: bool = True
    
    class Config:
        env_file = ".env"
        env_file_encoding = "utf-8"

# 创建设置实例
def get_settings():
    return Settings()

# 导出设置实例
settings = get_settings()
